package com.ruoyi.ruoyiqywechat.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ruoyiqywechat.mapper.PrivilegeConfigMapper;
import com.ruoyi.ruoyiqywechat.domain.PrivilegeConfig;
import com.ruoyi.ruoyiqywechat.service.IPrivilegeConfigService;

/**
 * 权益配置Service业务层处理
 * 
 * @author 好六
 * @date 2025-10-10
 */
@Service
public class PrivilegeConfigServiceImpl implements IPrivilegeConfigService 
{
    @Autowired
    private PrivilegeConfigMapper privilegeConfigMapper;

    /**
     * 查询权益配置
     * 
     * @param id 权益配置主键
     * @return 权益配置
     */
    @Override
    public PrivilegeConfig selectPrivilegeConfigById(Long id)
    {
        return privilegeConfigMapper.selectPrivilegeConfigById(id);
    }

    /**
     * 查询权益配置列表
     * 
     * @param privilegeConfig 权益配置
     * @return 权益配置
     */
    @Override
    public List<PrivilegeConfig> selectPrivilegeConfigList(PrivilegeConfig privilegeConfig)
    {
        return privilegeConfigMapper.selectPrivilegeConfigList(privilegeConfig);
    }

    /**
     * 新增权益配置
     * 
     * @param privilegeConfig 权益配置
     * @return 结果
     */
    @Override
    public int insertPrivilegeConfig(PrivilegeConfig privilegeConfig)
    {
        privilegeConfig.setCreateTime(DateUtils.getNowDate());
        return privilegeConfigMapper.insertPrivilegeConfig(privilegeConfig);
    }

    /**
     * 修改权益配置
     * 
     * @param privilegeConfig 权益配置
     * @return 结果
     */
    @Override
    public int updatePrivilegeConfig(PrivilegeConfig privilegeConfig)
    {
        privilegeConfig.setUpdateTime(DateUtils.getNowDate());
        return privilegeConfigMapper.updatePrivilegeConfig(privilegeConfig);
    }

    /**
     * 批量删除权益配置
     * 
     * @param ids 需要删除的权益配置主键
     * @return 结果
     */
    @Override
    public int deletePrivilegeConfigByIds(Long[] ids)
    {
        return privilegeConfigMapper.deletePrivilegeConfigByIds(ids);
    }

    /**
     * 删除权益配置信息
     * 
     * @param id 权益配置主键
     * @return 结果
     */
    @Override
    public int deletePrivilegeConfigById(Long id)
    {
        return privilegeConfigMapper.deletePrivilegeConfigById(id);
    }
}
